<?php
require '../script/mysqlconfig.php';
$conn = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>字段维护</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        body {
            position: relative;
        }
        td {
            text-align: right;
        }
        .select {
            top: 0;
            width: 100%;
            background-color: white;
        }
        .content {
            top: 50px;
            overflow: hidden;
            width: 100%;
            height: 100vh;
        }
        iframe {
            overflow: hidden;
            width: 100%;
            height: 100%;
            border: 0;
        }
    </style>
</head>
<body>
<div class="select">
    <form action="devicestatus.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="devicestatus">查询设备使用状态：</label>
        <input type="submit" value="查询">
    </form>
    <hr>

    <form action="brand.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="brandname">查询现有的设备品牌：</label>
        <input type="submit" value="查询">
    </form>
    <form action="brand.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="brandname">添加新的设备品牌：</label>
        <input type="text" id="brandname" name="brand">
        <input type="submit" value="保存">
    </form>
    <form action="ziduandel.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="brandname">输入要删除的设备品牌名字：</label>
        <input type="text" id="brandname" name="brand">
        <input type="submit" value="删除">
    </form>
    <hr>

    <form action="room.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="roomname">查询现有的机房：</label>
        <input type="submit" value="查询">
    </form>
    <form action="room.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="roomname">添加新的机房：</label>
        <input type="text" id="roomname" name="room">
        <input type="submit" value="保存">
    </form>
    <form action="ziduandel.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="roomname">输入要删除的机房名字：</label>
        <input type="text" id="roomname" name="room">
        <input type="submit" value="删除">
    </form>
    <hr>

    <form action="cabinet.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="cabinetname">输入机房名称，查询该机房中所有机柜编号：</label>
        <select id="cabinetname" name="room">
            <option value=0>------------请选择------------</option>
            <?php
            $sql= "select name from room";
            $result = $conn->query($sql);
            while($row = $result->fetch_assoc())
            {
                echo "<option value='$row[name]'>$row[name]</option>";
            }
            mysqli_close($conn);
            ?>
        </select>
        <input type="submit" value="查询">
    </form>
    <form action="cabinet.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="cabinetname">新的机柜编号：</label>
        <input type="text" id="cabinetname" name="cabinet">
        <label for="cabinetname">该机柜所属机房：</label>
        <input type="text" id="cabinetname" name="cabinet2">
        <input type="submit" value="保存">
    </form>
    <form action="ziduandel.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="cabinetname">输入要删除的机柜编号：</label>
        <input type="text" id="cabinetname" name="cabinet">
        <input type="submit" value="删除">
    </form>
    <hr>

    <form action="ip.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="ipname">输入机房名称，查询该机房中所有IP地址：</label>
        <input type="text" id="ipname" name="room">
        <input type="submit" value="查询">
    </form>
    <form action="ip.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="ipname">新的IP地址：</label>
        <input type="text" id="ipname" name="ip1">
        <label for="iproom">该IP所属机房：</label>
        <input type="text" id="iproom" name="ip2">
        <label for="ipyongtu">该IP主要用途：</label>
        <input type="text" id="ipyongtu" name="ip3">
        <input type="submit" value="保存">
    </form>
    <form action="ziduandel.php" method="post" enctype="multipart/form-data" target="dd3">
        <label for="ipname">输入要删除的IP地址：</label>
        <input type="text" id="ipname" name="ip">
        <input type="submit" value="删除">
    </form>
    <hr>

</div>
<div class="content">
    <iframe class="content-3" name="dd3"></iframe>
</div>
</body>
</html>
